package net.jalbum.filters.arty;

import net.jalbum.filters.arty.effects.*;
import se.datadosen.jalbum.JAFilter;
import se.datadosen.jalbum.Msg;

/**
 *
 * @author Sarah Schölzel
 */
public enum Effect {

    sunflower(SunflowerFilter.class, false),
    rainflower(RainflowerFilter.class, false),
    lily(LilyFilter.class, true),
    pink(PinkFilter.class, true),
    none(DummyFilter.class, false),
    tulip(TulipFilter.class, true),
    thistle(ThistleFilter.class, true),
    snowdrop(SnowdropFilter.class, false),
    daisy(DaisyFilter.class, false);
    
    private Class clazz;
    private boolean border;

    private Effect(Class clazz, boolean border) {
        this.clazz = clazz;
        this.border = border;
    }

    public JAFilter getFilter() {
        try {
            return (JAFilter) clazz.newInstance();
        } catch (Exception ex) {
            throw new RuntimeException(ex);
        }
    }

    /**
     * Draw extra visible border for icon painting
     */
    public boolean hasBorder() {
        return border;
    }

    @Override
    public String toString() {
        return Msg.getString(this, "filters.arty.names." + name());
    }
    
    public String getToolTip(){
        return Msg.getString(this, "filters.arty.tooltip." + name());
    }
}
